{layout name="../common/master"/}
<div id="right">
   <form action="javascript:;" method="post"  role="form">
   	<legend>为角色赋予权限</legend>
   	<div class="form-group">
   		<label for="">权限列表</label>
		<div class="checkbox">
			{foreach $data as $vo}
			<label>
				<input {if condition="in_array($vo['id'],$list)"}checked{/if} type="checkbox" name="idd[]" value="{$vo['id']}">
				{$vo['name']}&nbsp;&nbsp;&nbsp;&nbsp;
			</label>
			{/foreach}
		</div>
   	</div>
   	<button type="submit" id="form_submit" class="btn btn-primary">保存</button>
   </form>
</div>
<script>
	$(function(){
		$('#form_submit').click(function(){
			var data=$("form").serialize();
			data +='&id='+"{$_GET['id']}";
			$.post("{:URL('home/Systemmanage/setauthority')}",data,function(res){
					layer.msg(res.msg);
					location.href="{:URL('home/Systemmanage/authoritymanage')}";
			})
		})

	})
</script>